#coding:utf8


from like.models import Like
from common.utils.content_type import get_content_type_cache


def get_user_liked(user_id, ids, app_lebel, model):
    
    content_type = get_content_type_cache(app_lebel, model)
    
    likes = Like.objects.values('object_id').filter(content_type_id=content_type['id'], user_id=user_id, id__in=ids)
    
    return [ d['object_id'] for d in likes]
